import 'persion.dart';

void main() {
  Persion p1 = Persion('name', 18);

  p1.printUserInfor();

  Persion p2 = Persion.constrc1('flutter', 20);

  p2.printUserInfor();

  Persion p3 = Persion.constrc2('tikeyc', 20);

  p3.sexValue = 'man';

  p3.printUserInfor();

  print(p3.getSexValue);

  print('联级操作".."');
  // p3.name = 'tikeyc';
  // p3.age = 18;
  // p3.printUserInfor();
  p3
    ..name = 'tikeyc'
    ..age = 19
    ..printUserInfor();

  print('继承');
  Web web1 = Web('tikeyc', 16, 30);
  web1.printUserInfor();

  print('接口 interface');
  MySqlit mySqlit = MySqlit('url');
  mySqlit.add();

  print('mixins');
  MyMixins myMixins = MyMixins('url');
  myMixins.run();

  // identical:是否共享存储空间， 共享存储空间：1、常量2、值相等
  print(
      'identical(mySqlit, myMixins):${identical(mySqlit, myMixins)}'); // false

  var o1 = Object();
  var o2 = Object();
  print('identical(o1, o2):${identical(o1, o2)}'); // false

  var o11 = const Object();
  var o22 = const Object();
  print('identical(o11, o22): ${identical(o11, o22)}'); // true

  var list1 = [1];
  var list2 = [1];
  print('identical(list1, list2): ${identical(list1, list2)}'); // false
  print('identical(const [1], const [1]): ${identical(const [
        1
      ], const [
        1
      ])}'); // true
  print('identical(const [1], const [2]): ${identical(const [
        1
      ], const [
        2
      ])}'); // false
}
